
\begin{tikzpicture}[scale=.75]
  \clip (-1,-3.2) rectangle (6.2,7.2);
  \coordinate[label=left:$B$] (B) at (0,0);
  \coordinate[label=right:$C$] (C) at ({sqrt(29)},0);
  \coordinate[label=above:$A$] (A) at ({14/sqrt(29)}, {35/sqrt(29)});
  \coordinate[label=above right:$D$] (D) at ($ (B)!(A)!(C) $);
  \coordinate[label=left:$E$] (E) at ($ (A)!(C)!(B) $);
  \path[name path=AD] (A) -- (D);
  \path[name path=CE] (C) -- (E);
  \path[name intersections={of=AD and CE}]
    coordinate[label=above right:$F$] (F) at (intersection-1);
  \path[name path=AM] (A) -- ($ (D)!1! 180:(A) $);
  \path[name path=EM] (E) -- ($ (E)!4! 45:(B) $);
  \path[name intersections={of=AM and EM}]
    coordinate[label=below:$M$] (M) at (intersection-1);
  \coordinate[label=left:$G$] (G) at ($ (A)!(M)!(B) $);
  \pic[mark angle={green}{3mm}{1}] {right angle=C--E--A};
  \pic[mark angle={green}{3mm}{1}] {right angle=A--D--B};
  \pic[mark angle={green}{3mm}{1}] {right angle=M--G--B};
  \pic[mark angle={orange}{5mm}{1.4}, "$45^\circ$"] {angle=B--E--M};
  \pic[mark angle={orange}{5mm}{1.4}, "$45^\circ$"] {angle=M--E--C};
  \pic[mark angle={red}{5mm}{1}] {angle=M--B--E};
  \pic[mark angle={blue}{5mm}{1}] {angle=M--F--C};
  \draw (A) -- node[left] {$5$} (E) -- node[left] {$2$} (B)
    -- (M) -- (C) -- cycle (B) -- (C)
    (C) -- (F) -- node[above] {$2$} (E) (A) -- (M) (E) -- (M);
  \draw[dashed] (M) -- node[below, sloped] {$x+2$} (G)
    -- node[left] {$x$} (B);
  \fill[opafill=blue] (A) -- (E) -- (F) -- cycle;
  \fill[opafill=yellow] (C) -- (E) -- (M) -- cycle;
  \fill[opafill=cyan] (M) -- (G) -- (E) -- cycle;
\end{tikzpicture}
